home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / Visual Cafe Pro v1.0 / VISCAFE.BIN / InvisibleButton.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-06-19  |  951 b   |  33 lines

  1. package symantec.itools.awt;
  2.  
  3. import java.awt.Canvas;
  4. import java.awt.Component;
  5. import java.awt.Event;
  6. import java.awt.Graphics;
  7.  
  8. public class InvisibleButton extends Canvas implements TransparencyTrick {
  9.    protected boolean pressed = false;
  10.  
  11.    public void update(Graphics var1) {
  12.       this.paint(var1);
  13.    }
  14.  
  15.    public void paint(Graphics var1) {
  16.       TransparencyTrickUtils.paintComponentsBehind(this, var1);
  17.    }
  18.  
  19.    public boolean mouseDown(Event var1, int var2, int var3) {
  20.       this.pressed = true;
  21.       return true;
  22.    }
  23.  
  24.    public boolean mouseUp(Event var1, int var2, int var3) {
  25.       if (this.pressed) {
  26.          this.pressed = false;
  27.          ((Component)this).postEvent(new Event(this, 1001, (Object)null));
  28.       }
  29.  
  30.       return true;
  31.    }
  32. }
  33.